<%@page import="java.util.Iterator"%>
<%@page import="shop.factory.DAOFactory"%>
<%@page import="shop.vo.AdminBean"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%
	if (!(boolean)session.getAttribute("adminLogin")) {
		String path = request.getContextPath() + "/Admin/login.jsp";
		response.sendRedirect(path);
	}
%>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/jquery-1.10.2.min.js" type="text/javascript"
	charset="utf-8"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<title>管理员</title>
<style type="text/css">
	th,td{
		text-align: center;
	}
</style>
</head>
<body>
	<%
		try {
			List<AdminBean> list = DAOFactory.getIAdminDAOInstance()
					.listAdmin();
			Iterator<AdminBean> it = list.iterator();
	%>
	<center>
		<div class="container">
			<h3>管理员信息</h3>
			<div class="page-header" style="margin-top:10px ;"></div>
			<table class="table table-bordered table-condensed table-striped">
				<thead>
					<tr>
						<th>序号</th>
						<th>管理员账号</th>
						<th>管理员密码</th>
						<th>操作</th>
					</tr>
				</thead>
				<%
					while (it.hasNext()) {
							AdminBean admin = it.next();
				%>
				<tr class="warning">
					<td><%=admin.getAdmin_id()%></td>
					<td><%=admin.getAdmin_name()%></td>
					<td><%=admin.getAdmin_password()%></td>
					<td><a href="../AdminServlet?action=xiugai" target="mainFrame">修改密码</a></td>
				</tr>
				<%
					}
				%>
			</table>
		</div>
	</center>
	<%
		} catch (Exception e) {
			e.printStackTrace();
		}
	%>
</body>
</html>